package com.j1ay.forum.model.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author J1ay
 * @Date 2021/12/14 21:34
 * @Description 返回结果封装
 */

@Data
@AllArgsConstructor
public class Result {
    private boolean success;
    private int code;
    private String msg;
    private Object data;


    public static Result success(Object data) {
        return new Result(true, 200, "请求成功！", data);
    }

    public static Result fail(int code, String msg) {
        return new Result(false, code, msg, null);
    }
}
